using System;
using System.Collections.Generic;
using System.ComponentModel;
using Blazing.BusinessObjects.Cms;
using Blazing.BusinessObjects.Tagging;
using Blazing.BusinessObjects.Queries;
using Iesi.Collections.Generic;

namespace Blazing.WebFacade
{
    [System.ComponentModel.DataObject]
    public class StatisticController
    {
        #region StatisticLog
        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public void DeleteStatisticLog(StatisticLog statLog)
        {
            statLog.Delete();
            statLog.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
        public int NewStatisticLog(StatisticLog statLog)
        {
            statLog.Save();
            return statLog.ID;
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
        public void UpdateStatisticLog(StatisticLog statLog)
        {
            statLog.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticLog GetStatisticLog(int statLogId)
        {
            return StatisticLog.Load(statLogId);
        }
        #endregion


        #region StatisticOperatingSystem
        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public void DeleteStatisticOperatingSystem(StatisticOperatingSystem statOS)
        {
            statOS.Delete();
            statOS.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
        public int NewStatisticOperatingSystem(StatisticOperatingSystem statOS)
        {
            statOS.Save();
            return statOS.ID;
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
        public void UpdateStatisticOperatingSystem(StatisticOperatingSystem statOS)
        {
            statOS.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticOperatingSystem GetStatisticOperatingSystem(int statOsId)
        {
            return StatisticOperatingSystem.Load(statOsId);
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticOperatingSystem GetStatisticOperatingSystems(string osName)
        {
            return StatisticOperatingSystem.Fetch(QrySearchStatisticOperatingSystemsByName.Query(osName));
        }
        #endregion


        #region StatisticReferrer
        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public void DeleteStatisticReferrer(StatisticReferrer statReferrer)
        {
            statReferrer.Delete();
            statReferrer.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
        public int NewStatisticReferrer(StatisticReferrer statReferrer)
        {
            statReferrer.Save();
            return statReferrer.ID;
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
        public void UpdateStatisticReferrer(StatisticReferrer statReferrer)
        {
            statReferrer.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticReferrer GetStatisticReferrer(int statReferrerId)
        {
            return StatisticReferrer.Load(statReferrerId);
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticReferrer GetStatisticReferrers(string url)
        {
            return StatisticReferrer.Fetch(QrySearchStatisticReferrersByUrl.Query(url));
        }
        #endregion


        #region StatisticSession
        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public void DeleteStatisticSession(StatisticSession statSession)
        {
            statSession.Delete();
            statSession.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
        public int NewStatisticSession(StatisticSession statSession)
        {
            statSession.Save();
            return statSession.ID;
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
        public void UpdateStatisticSession(StatisticSession statSession)
        {
            statSession.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticSession GetStatisticSession(int statSessionId)
        {
            return StatisticSession.Load(statSessionId);
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticSession GetStatisticSessions(string sessionKey)
        {
            return StatisticSession.Fetch(QrySearchStatisticSessionsByKey.Query(sessionKey));
        }
        #endregion


        #region StatisticUseragent
        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public void DeleteStatisticUseragent(StatisticUseragent statUseragent)
        {
            statUseragent.Delete();
            statUseragent.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
        public int NewStatisticUseragent(StatisticUseragent statUseragent)
        {
            statUseragent.Save();
            return statUseragent.ID;
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
        public void UpdateStatisticUseragent(StatisticUseragent statUseragent)
        {
            statUseragent.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticUseragent GetStatisticUseragent(int statUseragentId)
        {
            return StatisticUseragent.Load(statUseragentId);
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticUseragent GetStatisticUseragents(string statUseragentName)
        {
            return StatisticUseragent.Fetch(QrySearchStatisticUseragentsByName.Query(statUseragentName));
        }
        #endregion
        

        #region StatisticVisitor
        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public void DeleteStatisticVisitor(StatisticVisitor statVisitor)
        {
            statVisitor.Delete();
            statVisitor.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
        public int NewStatisticVisitor(StatisticVisitor statVisitor)
        {
            statVisitor.Save();
            return statVisitor.ID;
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
        public void UpdateStatisticVisitor(StatisticVisitor statVisitor)
        {
            statVisitor.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticVisitor GetStatisticVisitors(int statVisitorId)
        {
            return StatisticVisitor.Load(statVisitorId);
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticVisitor GetStatisticVisitors(Guid guid)
        {
            return StatisticVisitor.Fetch(QrySearchStatisticVisitorsByGuid.Query(guid));
        }
        #endregion

        #region StatisticTaxonomyTag
        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public void DeleteStatisticTaxonomyTag(StatisticTaxonomyTag statTaxTag)
        {
            statTaxTag.Delete();
            statTaxTag.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
        public int NewStatisticTaxonomyTag(StatisticTaxonomyTag statTaxTag)
        {
            statTaxTag.Save();
            return statTaxTag.ID;
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
        public void UpdateStatisticTaxonomyTag(StatisticTaxonomyTag statTaxTag)
        {
            statTaxTag.Save();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticTaxonomyTag GetStatisticTaxonomyTag(int statTaxTagId)
        {
            return StatisticTaxonomyTag.Load(statTaxTagId);
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public StatisticTaxonomyTag GetStatisticTaxonomyTagByTaxTagID(int taxonomyTagID)
        {
            return StatisticTaxonomyTag.Fetch(QrySearchStatisticTaxonomyTagByID.Query(taxonomyTagID));
        }
        #endregion
    }
}
